<template>
	<view>
		<!-- <view class="top dis_fx fx_column fx_between">
			<view class="info dis_fx fx_column">
				<view class="img_box fz_0"><image src="../../static/test.png" mode="aspectFill"></image></view>
				<text>{{shareUserNikeName || "小河流水"}} 邀请你成为乐芭兔会员</text>
			</view>
			<image src="../../static/logo2.png" class="logo"></image>
		</view> -->
		
		
		<view  class="content">
			<view class="content">
				<view v-html="introduce"></view>
			</view>
			
		</view>
		
		<view class="bottom">
			<!-- <view class="text_box dis_fx fx_column fx_center">
				<image src="../../static/success_icon.png"></image><text @click="xieyiShow('show',0)">已同意《{{agreement[0].title || 乐芭兔旅行服务协议 }} 》及<text @click="xieyiShow('show',1)">《{{agreement[1].title || 隐私协议}}》</text>内容</text>
			</view> -->
			<view class="price dis_fx fx_column fx_center" @click="showWdirectShare">邀请好友</view>
		</view>
		<!-- 协议弹框 -->
		<!-- <view class="xieyi_box" v-if="xieyiState">
			<view class="xieyi">
				<view class="close_btn" @click="xieyiShow('hide',2)"></view>
				<view v-html="content"></view>
			</view>
		</view> -->
	</view>
</template>

<script>
	import wxShare from '../../common/wxShare.js'
	var jweixin = require('jweixin-module')
	import util from '../../common/util.js'
	export default {
		data() {
			return {
				
				introduce:"",  //介绍会员的好处
				userInfo:{}  //会员信息
			}
		},
		onShow() {
			 this.getShareInfo()
			 this.userInfo=JSON.parse(uni.getStorageSync('UserInfo'))
			 this.directShare();
		},
		methods: {
			//获取分享信息
			getShareInfo() {
				uni.showLoading({
					mask:true,
					title: '加载中'
				});
				var that = this
				util.fetchPost('/user/inviteIntroduce.do',{},function(res){
					var data=res.data;
					//console.log(data);
					that.introduce=data;
					uni.hideLoading();
				},function(){},true)
			},
			//直接分享
			directShare() {
				var that = this;
				var url=util.domain+"/#/pages/invite/invite";
				//url=url.replace("accept","invite")
				//url=url.replace("accept","invite")
				//url+="?reffent="+that.userInfo.userid;
				var param = {
					title: that.userInfo.nickName+"邀请你成为乐芭兔会员！",
					imgUrl: "",
					desc: that.userInfo.nickName+"邀请你成为乐芭兔会员！"
				}
				wxShare.share(param, url);
				/* uni.showModal({
					content: '请点击上方使用微信自带分享',
					showCancel: false
				}); */
			},
			
             showWdirectShare() {
				uni.showModal({
					content: '请点击上方使用微信自带分享',
					showCancel: false
				});
			},
		}
	}
</script>

<style>
.top{
	position: fixed;
	top: 44px;
	left: 0;
	width: 100%;
	background: #282828;
	height: 100upx;
	padding: 0 30upx;
}
.top .info .img_box{
	width: 60upx;
	height: 60upx;
	border-radius: 50%;
	overflow: hidden;
}
.top .info text{
	font-size: 24upx;
	color: #ffffff;
	margin-left: 10upx;
}
.top .logo{
	width: 150upx;
	height: 36upx;
}
.content{
	width: 100%;
}
.bottom{
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
}
.bottom .text_box{
	background: #EDEDED;
	height: 72upx;
}
.bottom .text_box image{
	width: 32upx;
	height: 32upx;
}
.bottom .text_box text{
	font-size: 20upx;
	color: #9a9a9a;
	margin-left: 15upx;
}
.bottom .price{
	font-size: 31upx;
	color: #000000;
	height: 100upx;
	background: #FFC801;
}
.xieyi_box{
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9;
}
.xieyi_box .xieyi{
	width: 80%;
	height: 80%;
	background: #fff;
	border-radius: 10upx;
	overflow-y: scroll;
	padding: 30upx;
	position: relative;
}
.xieyi_box .close_btn{
	background: url(../../static/clear_icon.png) no-repeat center/cover;
	width: 30upx;
	height: 30upx;
	position: absolute;
	right: 10upx;
	top: 10upx;
}
</style>
